﻿#pragma once
#include "FVertexNode.h"

class AdGraph
{
#pragma region Graph
public:
	TArray<FVertexNode*> _vertexList; //结点表
	int VertexCount;
	AdGraph(int vCount);

	void SetIndex(int index, FString value);
	FString GetIndex(int index);

	void AddEdge(int startVertexID, int endVertexID
		, int weight = 0);
	
#pragma endregion

#pragma region Kruskal
	TArray<TreeEdge*> GetEdges();

	int Find(const TArray<int>& parent, int f);

	//克鲁斯卡尔算法 最小生成树
	TArray<FSpanTreeNode*> MiniSpanTree();
	
#pragma endregion
	
};
